﻿@model IEnumerable<TagGroupEditModel>
@{
    SelectList groupSelectList = ViewData.Get<SelectList>("groupSelectList", null);
    string tenantTypeId = ViewData.Get<string>("tenantTypeId", string.Empty);
}
<form action="">
    <div class="tnc-dailog-pd">
        <div class="tn-form tn-label-right">
            <div class="tn-form-row">
                <label class="tn-form-label">分组名：</label>
                @Html.DropDownList("groupId",groupSelectList,"请选择")
            </div>
        </div>
    </div>
    <div class="tnc-artdilog-btn tn-bg-gray tn-border-gray tn-border-top">
        @Html.Button("提交", ButtonTypes.Button,HighlightStyles.Primary,htmlAttributes:new{ id="change-group-submit"})
        @Html.Button("取消", ButtonTypes.Button, HighlightStyles.Secondary, htmlAttributes: new { dialogOperation = "closeAll" })
    </div>
</form>
<script type="text/dialog">
this.title("设置分组");
</script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {

        //点击提交按钮
        $("#change-group-submit").click(function () {
            var data = '';
            $(".tag-id:checked").each(function () {
                data = data + "tagNames=" + $(this).attr("tagName") + "&";
            });
            data = data + "tenantTypeId=" + '@tenantTypeId' + "&";
            data = data + "groupId=" + $("#groupId").val();
            var url = "@SiteUrls.Instance()._SetTagsGroup()";
            $.post(url, data, function (data) {
                art.dialog.tips(data.MessageContent, 1.5, data.MessageType, function () {
                    window.location.reload();
                });
            });
        });

    });
</script>